fix: rename partially "Triple" to "Tuple" to reflect the new terminology (pt.2)#4834
fix: rename partially "Triple" to "Tuple" to reflect the new terminology (pt.2)#4834motorailgun wants to merge 5 commits intorust-lang:mainfrom
Conversation
a8eafdd to
475cb07
Compare
475cb07 to
b07ea10
Compare
There was a problem hiding this comment.
Pull request overview
This PR continues the terminology migration from “Triple” to “Tuple” (part 2 of the effort), updating types, modules, and user-facing strings without intending behavioral changes.
Changes:
- Renames
TargetTriple/PartialTargetTripletoTargetTuple/PartialTargetTupleacross core dist/config/CLI flows. - Moves the generated “known targets” list from
dist/tripletodist/tupleand updates the generator test accordingly. - Updates CLI prompts, logs, and tests/snapshots to say “tuple” instead of “triple”.
Reviewed changes
Copilot reviewed 15 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/suite/known_tuples.rs | Updates generator test to target the new src/dist/tuple/known.rs and renames parser helper. |
| tests/suite/cli_v2.rs | Updates tests to use TargetTuple in manifest manipulation. |
| tests/suite/cli_rustup.rs | Renames tests and expected stderr text from “triple” to “tuple”. |
| tests/suite/cli_inst_interactive.rs | Updates interactive installer snapshots/prompts from “host triple” to “host tuple”. |
| src/toolchain/names.rs | Switches resolver APIs and test imports to TargetTuple / tuple::known. |
| src/toolchain.rs | Changes installed-target parsing to return TargetTuple. |
| src/test/dist.rs | Updates mock dist server to construct/insert TargetTuple keys/values. |
| src/test.rs | Updates host detection helper to use TargetTuple::from_host. |
| src/errors.rs | Re-types error fields from TargetTriple to TargetTuple. |
| src/dist/tuple/known.rs | Adds the generated known arch/os/env lists under the new tuple module. |
| src/dist/tuple.rs | Renames PartialTargetTriple to PartialTargetTuple and updates tests/docs accordingly. |
| src/dist/mod.rs | Replaces triple module with tuple, renames TargetTriple to TargetTuple, and updates associated logic/tests. |
| src/dist/manifestation/tests.rs | Updates manifestation tests to construct components with TargetTuple. |
| src/dist/manifestation.rs | Renames manifestation target field to target_tuple and updates comparisons and lookup logic. |
| src/dist/manifest.rs | Switches manifest target maps/components and (de)serialization helpers to TargetTuple. |
| src/config.rs | Updates config flows to use TargetTuple (including default host resolution and checks). |
| src/cli/setup_mode.rs | Renames install option field to default_host_tuple. |
| src/cli/self_update/windows.rs | Updates Windows self-update MSVC checks to use tuple terminology/types. |
| src/cli/self_update.rs | Renames install options field/prompt/logging to “tuple” and updates host/build tuple usage. |
| src/cli/rustup_mode.rs | Updates CLI logic to use TargetTuple for host/target checks and target add/remove. |
| src/cli/common.rs | Updates shared CLI helpers to accept/use TargetTuple. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
88fe876 to
ce09c9a
Compare
|
|
||
| pub(crate) fn has_triple(&self) -> bool { | ||
| pub(crate) fn has_tuple(&self) -> bool { | ||
| self.target.arch.is_some() || self.target.os.is_some() || self.target.env.is_some() |
There was a problem hiding this comment.
Nit: Pre-existing, but I think you can extract before this commit a PartialTargetTriple::is_empty() helper, and then inline all uses of this function to !desc.target.is_empty(). That way the level of abstraction feels more correct and the overall logic is more readable to me... What do you think?
There was a problem hiding this comment.
Oh yeah that feels better especially because it is checking/digging self.target. Will look into more and fix this.
Partial effort to #4826, and continuous to #4827.
This PR still does not do functionality changes.
Opening as draft PR to rely on CI for Windows-only cfgs.<- fixed!